package com.orangelife.webservice.service.propFeeMeter;

import java.util.List;
import java.util.Map;

import javax.jws.WebParam;
import javax.jws.WebService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import org.apache.cxf.interceptor.InInterceptors;
import org.apache.cxf.interceptor.OutInterceptors;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;

import com.orangelife.service.propFeeMeter.model.EditMeterDto;
import com.orangelife.service.propFeeMeter.model.PropFeeMeterDto;

/*****************************************************************
 * Copyright(C) ORANGELIFE Corporation 2015. All Rights Reserved.
 *****************************************************************/
/*
 * ============================================================== 功能名
 * propFeeMeter类 的WebService基本作业
 * 
 * @author @author zhr
 * 
 * @version 1.1.0
 * 
 * @date 2016-07-04 11:04:21
 * ==============================================================
 */
@WebService
@InInterceptors(interceptors = "org.apache.cxf.interceptor.LoggingInInterceptor")
@OutInterceptors(interceptors = "org.apache.cxf.interceptor.LoggingOutInterceptor")
public interface IPropFeeMeterWebService {

	/**
	 * 用途 添加 （橙子生活）
	 * 
	 * @author zhr
	 * @date创建时间 2016-07-04 11:04:21
	 * @param servletRequest
	 * @param propFeeMeter
	 * @return
	 * @throws Exception
	 */

	@POST
	@Path("/add")
	@Produces({ "application/json" })
	public Response addPropFeeMeter(@Context HttpServletRequest servletRequest,
			@WebParam PropFeeMeterDto propFeeMeter) throws Exception;

	/****
	 * 批量添加数据
	 * 
	 * @param servletRequest
	 * @param propFeeMeter
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("/addPropFeeMeter")
	@Produces({ "application/json" })
	public Response insertPropFeeMeter(
			@Context HttpServletRequest servletRequest,
			@WebParam PropFeeMeterDto propFeeMeter) throws Exception;

	/**
	 * 用途 修改（橙子生活）
	 * 
	 * @author zhr
	 * @date创建时间 2016-07-04 11:04:21
	 * @param servletRequest
	 * @param propFeeMeter
	 * @return
	 * @throws Exception
	 */
	@PUT
	@Path("/edit")
	@Produces({ "application/json" })
	public Response editPropFeeMeter(
			@Context HttpServletRequest servletRequest,
			@WebParam PropFeeMeterDto propFeeMeter) throws Exception;

	/**
	 * 用途 删除（橙子生活）
	 * 
	 * @date 创建时间 2016-07-04 11:04:21
	 * @author zhr
	 * @param servletRequest
	 * @param meterID
	 * @return
	 * @throws Exception
	 */
	@DELETE
	@Path("{meterID}")
	@Produces({ "application/json" })
	public Response deletePropFeeMeter(
			@Context HttpServletRequest servletRequest,
			@PathParam("meterID") String meterID) throws Exception;

	/**
	 * 用途 详情（橙子生活）
	 * 
	 * @date 创建时间 2016-07-04 11:04:21
	 * @author zhr
	 * @param servletRequest
	 * @param meterID
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("{meterID}/")
	@Produces({ "application/json" })
	public Response findPropFeeMeterByID(
			@Context HttpServletRequest servletRequest,
			@PathParam("meterID") String meterID) throws Exception;

	/**
	 * 用途 查询列表（橙子生活）
	 * 
	 * @author zhr
	 * @date 创建时间 2016-07-04 11:04:21
	 * @param servletRequest
	 * @param search
	 *            搜索内容
	 * @param tsCreate
	 *            创建时间
	 * @param pageIndex
	 *            页码
	 * @param pageSize
	 *            页面大小
	 * @return
	 * @throws Exception
	 */
	@GET
	@Produces({ "application/json" })
	public Response getAllPropFeeMeter(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	/**
	 * 用途 查询列表（橙子生活）
	 * 
	 * @author zhr
	 * @date 创建时间 2016-07-04 11:04:21
	 * @param servletRequest
	 * @param search
	 *            搜索内容
	 * @param tsCreate
	 *            创建时间
	 * @param pageIndex
	 *            页码
	 * @param pageSize
	 *            页面大小
	 * @return
	 * @throws Exception
	 */

	@POST
	@Path("/bauthfinds")
	@Produces({ "application/json" })
	public Response bauthFindPropFeeMeters(
			@Context HttpServletRequest servletRequest,
			@WebParam Map<String, Object> propFeeMeter) throws Exception;

	/*****
	 * 查询树形
	 * 
	 * @param servletRequest
	 * @param propFeeMeter
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("/bauthfindTree")
	@Produces({ "application/json" })
	public Response bauthFindPropFeeMeterTree(
			@Context HttpServletRequest servletRequest,
			@WebParam Map<String, Object> propFeeMeter) throws Exception;

	/**
	 * 用途 查询列表（橙子生活）
	 * 
	 * @author zhr
	 * @date 创建时间 2016-07-04 11:04:21
	 * @param servletRequest
	 * @param search
	 *            搜索内容
	 * @param tsCreate
	 *            创建时间
	 * @param pageIndex
	 *            页码
	 * @param pageSize
	 *            页面大小
	 * @return
	 * @throws Exception
	 */

	@POST
	@Path("/bauthfind")
	@Produces({ "application/json" })
	public Response bauthFindPropFeeMeter(
			@Context HttpServletRequest servletRequest,
			@WebParam List<String> propFeeMeter) throws Exception;

	/***
	 * 批量删除
	 * 
	 * @param servletRequest
	 * @param propFeeMeter
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("/bauthEdit")
	@Produces({ "application/json" })
	public Response bauthEditPropFeeMeter(
			@Context HttpServletRequest servletRequest,
			@WebParam List<String> propFeeMeter) throws Exception;

	/***
	 * 获取没记录的表
	 * 
	 * @param servletRequest
	 * @param commID
	 * @param buildingID
	 * @param search
	 * @param tsCreate
	 * @param pageIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("/noRecord")
	@Produces({ "application/json" })
	public Response getNoRecordPropFeeMeter(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("buildingID") String buildingID,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	/***
	 * 获取初始化可修改的表
	 * 
	 * @param servletRequest
	 * @param commID
	 * @param buildingID
	 * @param search
	 * @param tsCreate
	 * @param pageIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("/initRecordList")
	@Produces({ "application/json" })
	public Response getInitRecordPropFeeMeter(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("buildingID") String buildingID,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	/****
	 * 批量初始化表的初始化信息信息
	 * 
	 * @param servletRequest
	 * @param propRecords
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("/addRecord")
	@Produces({ "application/json" })
	public Response bauthAddRecord(@Context HttpServletRequest servletRequest,
			@WebParam List<Map<String, Object>> propRecords) throws Exception;

	/***
	 * 下载初始化的excel
	 * 
	 * @param servletRequest
	 * @param servletResponse
	 * @param commID
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("downRecord")
	@Consumes({ "application/json" })
	@Produces(MediaType.APPLICATION_OCTET_STREAM)
	public Response downRecord(@Context HttpServletRequest servletRequest,
			@Context HttpServletResponse servletResponse,
			@QueryParam("search") String search,
			@QueryParam("commID") String commID, @QueryParam("comm") String comm)
			throws Exception;

	/***
	 * 导入表初始化的数据
	 * 
	 * @param servletRequest
	 * @param servletResponse
	 * @param attachments
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("/importRecord")
	@Consumes({ "multipart/form-data" })
	@Produces({ "application/json" })
	public Response ImportRecord(@Context HttpServletRequest servletRequest,
			@Context HttpServletResponse servletResponse,
			@QueryParam("commID") String commID, List<Attachment> attachments)
			throws Exception;

	/***
	 * 获取日志
	 * 
	 * @param servletRequest
	 * @param commID
	 * @param search
	 * @param tsCreate
	 * @param pageIndex
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("/logInfos")
	@Produces({ "application/json" })
	public Response getImportLogInfos(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("search") String search,
			@QueryParam("tsCreate") String tsCreate,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	/****
	 * 房屋单元楼栋树形
	 * 
	 * @param servletRequest
	 * @param type
	 * @param cityID
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("budingUnitApartTree")
	@Produces({ "application/json" })
	public Response findBudingUnitApartTree(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("meterTypeID") String meterTypeID) throws Exception;
	
	
	
	
	

	/****
	 * 根据时间和小区ID获取表读数
	 * 
	 * @param servletRequest
	 * @param type
	 * @param cityID
	 * @return
	 * @throws Exception
	 */
	@GET
	@Path("meterRecord")
	@Produces({ "application/json" })
	public Response getMeterRecord(
			@Context HttpServletRequest servletRequest,
			@QueryParam("commID") String commID,
			@QueryParam("meterTypeID") String meterTypeID,
			@QueryParam("period") String period,
			@QueryParam("type") String type,
			@QueryParam("buildingID") String buildingID,
			@QueryParam("unitID") String unitID,
			@QueryParam("isempty") String isempty,
			@QueryParam("pageIndex") String pageIndex,
			@QueryParam("pageSize") String pageSize) throws Exception;

	
	/****
	 * 根据时间和小区ID获取表读数
	 * 
	 * @param servletRequest
	 * @param type
	 * @param cityID
	 * @return
	 * @throws Exception
	 */
	@POST
	@Path("meterRecordBymap")
	@Produces({ "application/json" })
	public Response getMeterRecordBymap(
			@Context HttpServletRequest servletRequest,
			@WebParam Map<String, Object> param) throws Exception;
	
	/****
	 * 根据时间和小区ID获取表读数
	 * 
	 * @param servletRequest
	 * @param type
	 * @param cityID
	 * @return
	 * @throws Exception
	 */
	@PUT
	@Path("editMeterRecord")
	@Produces({ "application/json" })
	public Response editMeterRecord(
			@Context HttpServletRequest servletRequest,
			@WebParam EditMeterDto editMeterDto) throws Exception;
}
